<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ID获取dom</title>
  </head>

  <body>
    <div id="div">123</div>
  </body>
  <script>
    /* 
    DOM通过iD获取
    console.dir():可以打印我们获取的元素对象，更好的查看对象里面的属性和方法。
    */
    var div = document.getElementById("div");
    console.dir(div);
  </script>

</html>